package com.android.djlmapp.js_interface.morefun;

import android.content.Context;
import android.webkit.JavascriptInterface;

import com.android.djlmapp.js_interface.BaseJsInterface;
import com.just.agentweb.AgentWeb;

/**
 * @Author wangziheng
 * @ProjectName djlm
 * @ClassName MoreFunJsInterface
 * @package com.android.djlmapp.jsInterface.recharge
 * @data 2018/12/24 12:30
 * @Describe
 * @Change
 */
public class MoreFunJsInterface extends BaseJsInterface {
    AbMoreFunJsInterfaceCallBack mRechargeJsInterfaceCallBack;

    static final String TAG = "MoreFunJsInterface";
    public MoreFunJsInterface(Context context, AbMoreFunJsInterfaceCallBack jsInterfaceCallBack, AgentWeb agentWeb) {
        super(context, jsInterfaceCallBack,agentWeb);
        mRechargeJsInterfaceCallBack = jsInterfaceCallBack;
    }

    /**
     * 废卡重置
     */
    @JavascriptInterface
    public void feika() {
        getHandler().post(() -> mRechargeJsInterfaceCallBack.fkcz());
    }

    /**
     * 废卡重置结果
     *
     * @param msg
     */
    @JavascriptInterface
    public void feika_msg(String msg) {
        getHandler().post(() -> mRechargeJsInterfaceCallBack.fkczResult(msg));
    }

    /**
     * 派单
     */
    @JavascriptInterface
    public void lt_qdpd() {
        getHandler().post(() -> mRechargeJsInterfaceCallBack.qdpd());
    }

    /**
     * 保存图片
     */
    @JavascriptInterface
    public void saveImage(String imgUrl) {
        getHandler().post(() -> mRechargeJsInterfaceCallBack.saveImg(imgUrl));
    }

    /**
     * 读身份证
     */
    @JavascriptInterface
    public void read_idcard() {
        getHandler().post(() -> mRechargeJsInterfaceCallBack.readIDCard());
    }
    /**
     * 补卡回调
     *
     * @param json
     */
    @JavascriptInterface
    public void onSubmit(String json) {
        getHandler().post(() -> mRechargeJsInterfaceCallBack.bkSubmit(json));
    }

    /**
     * 搜索手机号
     * @param json
     */
    @JavascriptInterface
    public void NativeGetPhonenum(String json){
        getHandler().post(() -> mRechargeJsInterfaceCallBack.getPhoneNum(json));
    }

    /**
     * SIM卡号
     */
    @JavascriptInterface
    public void NativeScanSim(){
        getHandler().post(() -> mRechargeJsInterfaceCallBack.getSimNum());
    }

    /**
     * 去订单列表
     */
    @JavascriptInterface
    public void NativeGoOrder(){
        getHandler().post(() -> mRechargeJsInterfaceCallBack.goOrderList());
    }

    /**
     * 获取签名照
     */
    @JavascriptInterface
    public void  NativeGetSign(){
        getHandler().post(() -> mRechargeJsInterfaceCallBack.getSignImg());
    }

    /**
     * 获取照片
     */
    @JavascriptInterface
    public void NativeGetImage(){
        getHandler().post(() -> mRechargeJsInterfaceCallBack.getImgs());
    }

}
